﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PaperTest.aspx.cs" Inherits="OnLineExam.Web.PaperTest" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>查看成绩</title>
    <link href="assets/layui/2.2.5/css/layui.css" rel="stylesheet" />

    <link href="../../assets/easyui/1.5.4.4/themes/bootstrap/easyui.css" rel="stylesheet" />
    <link href="../../assets/easyui/1.5.4.4/themes/icon.css" rel="stylesheet" />

    <script src="../../assets/easyui/1.5.4.4/jquery.min.js"></script>
    <script src="../../assets/easyui/1.5.4.4/jquery.easyui.min.js"></script>
    <script src="../../assets/easyui/1.5.4.4/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
        <legend><%= PaperName %></legend>
    </fieldset>
    <div id="view">
    </div>
    <script>
        function isEmpty(obj){
        obj=obj+'';
        obj=$.trim(obj);
    if(typeof obj == "undefined" || obj == null || obj == ""||obj=='null'){
        return true;
    }else{
        return false;
    }
}
    </script>
    <script id="singleTp" type="text/html">

        {{#  layui.each(d.rows, function(index, item){ }}

        <div class="layui-form-item" title="{{ item.ID }}">

            {{#  layui.each(d.items, function(index, qitem){ }}

				<div class="layui-inline">
					<div class="layui-card">
						<div class="layui-card-header"><input id="singleRep_rb{{qitem}}_{{ item.ID }}" type="radio" name="singleRep_rb_{{ item.ID }}" value="{{qitem}}" /></div>
						<div class="layui-card-body">
							{{ item.  }} 
						</div>
					</div>
				</div>
            {{#  }); }}
             </div>
        {{#  }); }}
    </script>

     

    <script src="assets/layui/2.2.5/layui.all.js"></script>
    <script>
        var userId = '<%=User.Identity.Name%>';
        var scoreId = '<%=Request.QueryString["id"] %>';
        var qtype = "";
        layui.use('laytpl', function () {
            var laytpl = layui.laytpl;

            $.getJSON("handler/userAnswerHandler.ashx?qtype=&id=" + scoreId + '&type=getlist', function (rps) {

                var datas = {
                    items: ["A", 'B', 'C', 'D']
                    ,rows:rps
                }


                var getTpl = singleTp.innerHTML
                    , view = document.getElementById('view');
                laytpl(getTpl).render(datas, function (html) {
                    view.innerHTML = html;
                });
            });


        });



    </script>



    <script>

        $(function () {
            $('#tt').datagrid({

                idField: 'ID',
                url: "handler/userAnswerHandler.ashx?c=<%=DateTime.Now.ToString("ffffff")%>",
                queryParams: { "qtype": qtype, "id": scoreId, "type": "getlist" },
                singleSelect: true, sortName: 'QuestionTypeStr', sortOrder: "asc",
                width: 'auto', height: 'auto',
                columns: [[
                    //{ field: 'ID', title: '序号' },
                    //{ field: 'UserID', title: '工号' },
                    //{ field: 'PaperName', title: '试卷' },
                    { field: 'QuestionTypeStr', title: '类型', sort: true },

                    { field: 'Title', title: '题目' },
                    { field: 'Question', title: '选项' },
                    { field: 'QuestionAnswer', title: '答案' },
                    { field: 'UserAnswer1', title: '作答' },
                    { field: 'UserMark', title: '得分' },                    { field: 'ExamTime', title: '时间' }
                ]]
            });


        });

    </script>
</body>
</html>
